package com.example.demo.controller;

import com.example.demo.service.ChangePasswordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/api/user")
public class ChangePasswordController {

    @Autowired
    private ChangePasswordService changePasswordService;

    // 修改密码
    @PostMapping("/changePassword/{jobNum}")
    public boolean getUserByJobNum(@PathVariable Integer jobNum,
                                   @RequestParam String oldPassword,
                                   @RequestParam String newPassword) {
        return changePasswordService.change(jobNum, oldPassword, newPassword);
    }
}

